package com.softjourn.punchcard.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonAutoDetect
@JsonIgnoreProperties(ignoreUnknown= true)
public class Offer implements Parcelable {

	private int bonuses;

	private String uid;

	private String name;
	
	public Offer() {
		
	}

	public int getBonuses() {
		return bonuses;
	}

	public void setBonuses(int bonuses) {
		this.bonuses = bonuses;
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "Offer [bonuses=" + bonuses + ", uid=" + uid + ", name=" + name
				+ "]";
	}
	
	public Offer(Parcel in) {
		readFromParcel(in);
	}
	
	@Override
	public int describeContents() {
		return 0;
	}
	
	@Override
	public void writeToParcel(Parcel parcel, int flags) {
		parcel.writeInt(bonuses);
		parcel.writeString(uid);
		parcel.writeString(name);
	}
	
	private void readFromParcel(Parcel in) {
		bonuses = in.readInt();
		uid = in.readString();
		name = in.readString();
	}
	
	public static final Parcelable.Creator<Offer> CREATOR =
			new Parcelable.Creator<Offer>() {
				public Offer createFromParcel(Parcel in) {
					return new Offer(in);
				}
				
				public Offer[] newArray(int size) {
					return new Offer[size];
				}
			};

}
